#include "stdafx.h"

int APIENTRY wWinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int)
{
	SC_HANDLE serviceManager = ::OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_ALL_ACCESS);

	SC_HANDLE service = ::OpenService(serviceManager, _T("VMAuthdService"), SERVICE_ALL_ACCESS);
	::StartService(service, 0, NULL);
	::CloseServiceHandle(service);

	service = ::OpenService(serviceManager, _T("VMnetDHCP"), SERVICE_ALL_ACCESS);
	::StartService(service, 0, NULL);
	::CloseServiceHandle(service);

	service = ::OpenService(serviceManager, _T("VMware NAT Service"), SERVICE_ALL_ACCESS);
	::StartService(service, 0, NULL);
	::CloseServiceHandle(service);

	service = ::OpenService(serviceManager, _T("VMUSBArbService"), SERVICE_ALL_ACCESS);
	::StartService(service, 0, NULL);
	::CloseServiceHandle(service);

	service = ::OpenService(serviceManager, _T("VMwareHostd"), SERVICE_ALL_ACCESS);
	::StartService(service, 0, NULL);
	::CloseServiceHandle(service);

	::CloseServiceHandle(serviceManager);

	::WinExec("vmware.exe", SW_SHOW);

	return 0;
}
